﻿<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="cities.aspx.vb" Inherits="admin_cities" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <title>SmartTaxi управление - список заказов

    </title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="row">
        <h3 style="border-bottom: 1px solid #c6c6c6">Список заказов</h3>
        <div class="row" style="padding-left:35px; padding-right:35px;">
            <table style="width:100%;">
                <tr>

                    <td style="width: 20%;" valign="top">

                        <div class="col-sm-4">
                            <asp:Label ID="Label1" runat="server" AssociatedControlID="select_city" Style="width: initial;" Text="Укажите город"></asp:Label>
                            <asp:DropDownList ID="select_city" runat="server" DataSourceID="SqlDataSource1" DataTextField="city_name" DataValueField="city_id">
                            </asp:DropDownList><asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:1gb_smarttaxiConnectionString %>" SelectCommand="SELECT [city_id], [city_name] FROM [cities]" DeleteCommand="DELETE FROM taxist WHERE (taxi_id = @id)">
                                <DeleteParameters>
                                    <asp:ControlParameter ControlID="GridView1" Name="id" PropertyName="SelectedValue" />
                                </DeleteParameters>
                            </asp:SqlDataSource>
                        </div>

                    </td>

                    <td style="width: 20%;" valign="top">

                        <div class="col-sm-4">
                            <asp:Label ID="Label2" runat="server" Style="width: initial;" Text="Укажите период с" AssociatedControlID="period_from"></asp:Label>
                            <asp:TextBox ID="period_from" runat="server" CssClass="period_from"></asp:TextBox>
                        </div>

                    </td>

                    <td style="width: 20%;" valign="top">

                        <div class="col-sm-4">
                            <asp:Label ID="Label3" runat="server" Style="width: initial;" Text="Укажите период до" AssociatedControlID="period_to"></asp:Label>
                            <asp:TextBox ID="period_to" runat="server" CssClass="period_to"></asp:TextBox>
                        </div>

                    </td>

                    <td style="width:20%; padding-bottom:10px;" valign="bottom">

                        <asp:Button ID="Button1" runat="server" Text="Отобразить" CssClass="btn btn-primary" />

                    </td>
                    <td style="width:20%;">&nbsp;</td>
                </tr>
            </table>

            <br />

             </div>
        <div class="row">
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="order_id" DataSourceID="SqlDataSource2" Width="100%">
                <Columns>
                    <asp:BoundField DataField="order_user_phone" HeaderText="Клиент" SortExpression="order_user_phone" />
                    <asp:BoundField DataField="taxt_firstname" HeaderText="Имя водителя" />
                    <asp:BoundField DataField="taxi_lastname" HeaderText="Фамилия" />
                    <asp:BoundField DataField="order_from_address" HeaderText="Из" SortExpression="order_from_address" />
                    <asp:BoundField DataField="order_to_address" HeaderText="В" SortExpression="order_to_address" />
                    <asp:BoundField DataField="order_comment" HeaderText="Комментарий" SortExpression="order_comment" />
                    <asp:BoundField DataField="order_time" HeaderText="Время заказа" SortExpression="order_create" />
                    <asp:BoundField DataField="torder_price" HeaderText="Цена" SortExpression="torder_price" />
                </Columns>
            </asp:GridView>
            <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:1gb_smarttaxiConnectionString %>" SelectCommand="SELECT orders.order_id, orders.client_id, orders.order_from_address, orders.order_from_location, orders.order_to_address, orders.order_to_location, orders.order_comment, orders.order_status, orders.order_time, orders.order_create, orders.order_user_phone, torders.torder_id, torders.taxi_id, torders.client_id AS Expr1, torders.order_id AS Expr2, torders.torder_price, torders.torder_status, torders.torder_created, torders.torder_update, torders.torder_taxi_arrived, taxist.taxi_id AS Expr3, taxist.taxi_location, taxist.taxi_isonline, taxist.taxt_firstname, taxist.taxi_lastname, taxist.taxi_photo, taxist.taxi_carnumber, taxist.taxi_marka, taxist.taxi_model, taxist.taxi_color, taxist.taxi_password, taxist.taxi_phone, taxist.taxi_phoneconfirm, taxist.taxi_created, taxist.taxi_isacepted, taxist.city_id, taxist.last_code, taxist.last_reser, taxist.taxi_lastaction FROM orders INNER JOIN torders ON orders.order_id = torders.order_id INNER JOIN taxist ON torders.taxi_id = taxist.taxi_id WHERE (torders.torder_status &gt; 6 AND orders.order_create &gt;= convert(datetime, @df, 104) AND orders.order_create &lt;= convert(datetime, @dt, 104) AND taxist.city_id = @ct)">
                <SelectParameters>
                    <asp:ControlParameter ControlID="period_from" Name="df" PropertyName="Text" />
                    <asp:ControlParameter ControlID="period_to" Name="dt" PropertyName="Text" />
                    <asp:ControlParameter ControlID="select_city" Name="ct" PropertyName="SelectedValue" />
                </SelectParameters>
            </asp:SqlDataSource>
        </div>
    </div>

</asp:Content>

